//package cn.itcast.hotel.common.config;
//
//import org.springframework.boot.web.servlet.error.ErrorController;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.servlet.ModelAndView;
//
//import javax.servlet.http.HttpServletRequest;
//
//
///**
// * @ClassName ErrorPageController
// * @Author By wen
// * @Description 自定义错误页面跳转
// * @Date 2023/7/7 14:08
// * @Version 1.0
// */
//@Controller
//public class ErrorPageController implements ErrorController {
//
//    /**
//     * The return value from this method is not used; the property `server.error.path`
//     * must be set to override the default error page path.
//     *
//     * @return the error path
//     * @deprecated since 2.3.0 for removal in 2.5.0 in favor of setting the property
//     * `server.error.path`
//     */
//    @Override
//    public String getErrorPath() {
//        return "/error";
//    }
//
//    @RequestMapping("/error")
//    public String handleError(HttpServletRequest request){
//        //获取statusCode:401,404,500
////        ModelAndView modelAndView = new ModelAndView();
////
////        Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code");
////        if(statusCode == 401){
////
////        }else if(statusCode == 404){
////            modelAndView.setViewName("123");
////            return "123.html";
////        }else if(statusCode == 403){
////
////        }else{
////
////        }
////        modelAndView.setViewName("head.html");
//        return "404";
//    }
//
//}
